<template>
	<view class="">
		<view class="search p20">
			<u-search placeholder="搜索法事" shape="round" v-model="keyword"
				@search="jump('/pages/preview/index?keyword='+keyword)" :showAction="false"></u-search>
		</view>
		<u-swiper :list="banner" height="340rpx" indicator indicatorMode="dot"></u-swiper>
		<view class="notice" v-if="init.notice">
			<u-notice-bar :text="init.notice" mode="link" bgColor="#fff" color="#333"></u-notice-bar>
		</view>
		<view class="yuyue d-s-c m50 p30" @click="jump('/pages/reservation/hospital')">
			<image src="@/static/image/ren.png" mode="widthFix" class="mr10"></image>
			<text class="mr30 f26">入寺预约</text>
			<u-icon name="arrow-right" size="20"></u-icon>
		</view>
		<view class="menu d-b-c f26 p20">
			<view class="item br12 d-c-c d-c" @click="jump('/pages/preview/index')">
				<image src="@/static/image/menu1.png" mode="widthFix"></image>
				<text class="mt5">活动安排</text>
			</view>
			<view class="item br12 d-c-c d-c" @click="jump('/pages/reservation/index')">
				<image src="@/static/image/menu2.png" mode="widthFix"></image>
				<text class="mt5">活动预约</text>
			</view>
			<view class="item br12 d-c-c d-c" @click="jump('/pages/reservation/conversion')">
				<image src="@/static/image/menu3.png" mode="widthFix"></image>
				<text class="mt5">皈依登记</text>
			</view>
			<view class="item br12 d-c-c d-c" @click="jump('/pages/reservation/recruit')">
				<image src="@/static/image/menu4.png" mode="widthFix"></image>
				<text class="mt5">义工招募</text>
			</view>
		</view>
		<view class="order m20 pl20 pr20 pb60 br20 d-c d-e-e">
			<view class="bg-white p20 br20">
				<view class="title f26">福兴禅寺简介</view>
				<view class="content f22 mt40" v-html="init.jianjie"></view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				keyword: "",
				// notice: "通告 I 2025年春节期间福兴禅寺对外开放时间",
				banner: [],
				init: {},
			};
		},
		onLoad() {
			this.getBan();

		},
		onShow() {
			this.getInit()

		},
		methods: {
			getInit() {
				if (uni.getStorageSync("init")) {
					this.init = uni.getStorageSync("init");
					if (this.init) uni.setNavigationBarTitle({ title: this.init.name });
				} else {
					setTimeout(() => {
						this.getInit()
					}, 200)
				}
			},
			jump(url) {
				uni.navigateTo({
					url,
				});
			},
			async getBan() {
				const res = await this.$request({
					url: this.$api.banner,
				});
				this.banner = res.data;
			},
			async getNotice() {
				const res = await this.$request({
					url: this.$api.notice,
				});
			},
		},
	};
</script>

<style scoped lang="scss">
	.yuyue {
		// margin: 50rpx;
		background-image: linear-gradient(to right, #fff, #FFBD8E);
		border-radius: 20rpx;
		border: 1px solid #eee;

		image {
			width: 60rpx;
			height: 60rpx;
			// margin-right: 5rpx;
		}
	}

	.order {
		height: 520rpx;
		background-position: center;
		background-repeat: no-repeat;
		background-size: cover;
		background-image: url("@/static/image/0.png");

		// position: relative;
		.title {
			position: relative;

			&::before {
				z-index: 0;
				position: absolute;
				bottom: -5rpx;
				content: "";
				height: 10rpx;
				width: 6em;
				background-image: linear-gradient(to right, #ff7f13, transparent);
			}
		}

		.content {
			text-indent: 2em;
			line-height: 30rpx;
		}
	}

	.menu {
		.item {
			background-color: #eee;
			width: 140rpx;
			height: 140rpx;

			image {
				width: 60rpx;
			}
		}
	}
</style>